<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%-- Add portlet taglibs to jsp --%>
<%@ page import="javax.portlet.*"%>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<portlet:defineObjects />

<script type="text/javascript"
  src='/${requestScope.contextPath}/scripts/common.js'></script>

<b> Add - Demo Data Validation</b>
<br />
<form name="<portlet:namespace/>addForm" action="<portlet:actionURL/>" method="POST" enctype="multipart/form-data">
  <input type="hidden" name="screenId" value="Add" />
  <input type="hidden" name="eventId" value="" />

<%-- Display errors --%>
  <c:forEach var="error" items="${errors}">
    ${error.fieldName}: ${error.errorMessage}
    <br/>
  </c:forEach>
  <table border="0" width="55%" cellspacing="0" cellpadding="0">
    <tr>
      <td width="81">Full name(*)</td>
      <td>

        <p>
          <input type="text" name="fullName" size="20"
            value="${requestScope.formBean.fullName}">
        </p>
      </td>
    </tr>
    <tr>
      <td width="81">Birthday</td>
      <td><input type="text" name="birthday" size="10" value="${requestScope.formBean.birthday}">(dd/mm/yyyy;
        &lt;= tomorrow)</td>
    </tr>
    <tr>
      <td width="81">Address</td>
      <td><textarea rows="2" name="address" cols="20" value="${requestScope.formBean.address}"></textarea>
      </td>
    </tr>
    <tr>
      <td width="81">Toefl mark</td>
      <td><input type="text" name="toeflMark" size="10" value="${requestScope.formBean.toeflMark}"> (0
        ~ 1000)</td>
    </tr>
    <tr>
      <td width="81">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
  <input type="button" name="add" value="Add"
    onclick='submitAction("<portlet:namespace/>","addForm","addEvent");' />